-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Implement slashing protection interchange format #1544
Conversation
Are you implementing both formats from the doc? Or should teku instead just use the first format and just provide one stubbed message for attestations and blocks |
@djrtwo Yeah I've already implemented both! I just need to write some tests and a CLI porcelain, but have been distracted by fixing some DB issues |
I'm planning to try a different approach to importing the minimal format. Rather than filling the DB with fake blocks for every slot from 0 to A similar low watermark for attestations will obsolete the need for the Glossary:
|
428304a
to
6d77a3a
Compare
f50c3a4
to
0be58dc
Compare
0be58dc
to
a49abeb
Compare
Blocked on #1588 |
## Proposed Changes This is an extraction of the quoted int code from #1569, that I've come to rely on for #1544. It allows us to parse integers from serde strings in YAML, JSON, etc. The main differences from the code in Paul's original PR are: * Added a submodule that makes quoting mandatory (`require_quotes`). * Decoding is generic over the type `T` being decoded. You can use `#[serde(with = "serde_utils::quoted_u64::require_quotes")]` on `Epoch` and `Slot` fields (this is what I do in my slashing protection PR). I've turned on quoting for `Epoch` and `Slot` in this PR, but will leave the other `types` changes to you Paul. I opted to put everything in the `conseus/serde_utils` module so that BLS can use it without a circular dependency. In future when we want to publish `types` I think we could publish `serde_utils` as `lighthouse_serde_utils` or something. Open to other ideas on this front too.
a49abeb
to
1701c1a
Compare
This is ready for review! There's one FIXME that depends on #1532, but that should be straight-forward to resolve once one of these PRs is merged. |
Marking this as WIP again, because it needs updating for v4 of the spec |
This is ready to roll again, just waiting on resolution of merge conflicts in #1532 |
0a1f1b8
to
0924a60
Compare
1dbd537
to
f80fcb3
Compare
55107d0
to
29709c5
Compare
60765fb
to
86730f3
Compare
1ad28c0
to
22aedda
Compare
Also fix a bug with double registration of validators
ce55656
to
07f93ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive, especially with all the test vectors and interop contribution!
I just have a few comments. I played around with it and it worked great, I had a couple of suggestions for logs that might reduce our support load.
All comments addressed 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! 🎉
Thanks! bors r+ |
## Issue Addressed Implements support for importing and exporting the slashing protection DB interchange format described here: https://hackmd.io/@sproul/Bk0Y0qdGD Also closes #1584 ## Proposed Changes * [x] Support for serializing and deserializing the format * [x] Support for importing and exporting Lighthouse's database * [x] CLI commands to invoke import and export * [x] Export to minimal format (required when a minimal format has been previously imported) * [x] Tests for export to minimal (utilising mixed importing and attestation signing?) * [x] Tests for import/export of complete format, and import of minimal format * [x] ~~Prevent attestations with sources less than our max source (Danny's suggestion). Required for the fake attestation that we put in for the minimal format to block attestations from source 0.~~ * [x] Add the concept of a "low watermark" for compatibility with the minimal format Bonus! * [x] A fix to a potentially nasty bug involving validators getting re-registered each time the validator client ran! Thankfully, the ordering of keys meant that the validator IDs used for attestations and blocks remained stable -- otherwise we could have had some slashings on our hands! 😱 * [x] Tests to confirm that this bug is indeed vanquished
Pull request successfully merged into v0.3.0-staging. Build succeeded: |
Issue Addressed
Implements support for importing and exporting the slashing protection DB interchange format described here:
https://hackmd.io/@sproul/Bk0Y0qdGD
Also closes #1584
Proposed Changes
Prevent attestations with sources less than our max source (Danny's suggestion). Required for the fake attestation that we put in for the minimal format to block attestations from source 0.Bonus!